const state = {
	homeInfo:{},
	navInfo:{}
}
const mutations = {
	SET_HOME_INFO(state,homeInfo){
		state.homeInfo=homeInfo
	},
	SET_NAV_INFO(state,navInfo){
		state.navInfo=navInfo
	},
	REMOVE_NAV_INFO(state){
		state.navInfo= {}
	},
}
const actions = {
	async getHomeInfo({commit}){
		const result =await this.$API.home.getHomeInfo()
		if(result.code === '200'){
			commit('SET_HOME_INFO',result.data.data)
		}
	},
	async getNavInfo({commit},{time,categoryId}){
		const result =await this.$API.home.getNavInfo(time,categoryId)
		commit('SET_NAV_INFO',result.data)
	},
}
const getters = {}

export default {
	state,
	mutations,
	actions,
	getters
}
